package various_tmp;

import geom.Dimension2i;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import states.GameState;
import states.TitleState;


public class Game extends StateBasedGame 
{	  
	
	//****************************************************
	// ATTRIBUTS STATICS
	public static final String GAME_NAME = "Apoke";
	  
	public static final int TITLE_STATE = 0;
	public static final int GAME_STATE = 1;
	public static final int OPTIONS_STATE = 2;
  
	
	private static Game self;
  
 
  //****************************************************
  // ATTRIBUTS
  private Dimension2i resolution = new Dimension2i(800,600);
	
  
  //****************************************************
  // CONSTRUCTOR
  private Game(String name) 
  {
    super(Game.GAME_NAME);
  }
  
  public static Game getInstance()
  {
	  if(null == self)
		  self = new Game(GAME_NAME);
	  
	  return self;
  }
  
  //****************************************************
  // METHODS

  @Override
  public void initStatesList(GameContainer arg0) throws SlickException 
  {
    addState(new TitleState());
    addState(new GameState());
  }
  
  //*****************************************************
  // GETTERS / SETTERS
  public Dimension2i getResolution(){
	  return this.resolution;
  }

  public void setResolution(Dimension2i d){
	  this.resolution = d;
  }
  


  
  
}
